package ProxyPattern;

/**
 * @version: java version 1.8
 * @Author: Zheng
 * @description:
 * @date: 2022-08-15 21:59
 */
public class ProxyImage implements Image{
    private RealImage realImage;
    private String fileName;

    public ProxyImage(String fileName) {
        this.fileName = fileName;
    }

    @Override
    public void displaye() {
        if (realImage==null){
            realImage=new RealImage(fileName);
        }
        realImage.displaye();
    }
}
